package Thread;

import static java.lang.Thread.sleep;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2023-01-09
 * Time: 22:24
 */
public class Thread6 {
    public static void main(String[] args) throws InterruptedException {
        boolean Flag = true;
        Thread t = new Thread(() ->{
            while (Flag){
                System.out.println("Hello thread");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }

            }
        });
        t.start();
        Thread.sleep(3000);
    }
}
